<?php 
    session_start();
?>
<?php

 /*** error reporting on ***/
 error_reporting(E_ALL);

 /*** define the site path ***/
 $site_path = realpath(dirname(__FILE__));
 define ('__SITE_PATH', $site_path);

 /*** include the init.php file ***/
 include 'Include/application/init.php';
 
 include 'config.php';
 include 'functions.php';

 include 'Include/DBConfig.php';
 
 include 'Include/Language.php';
 
include 'Include/LogFile.php';

include 'Include/MyException.php';

//bien cau hinh
$config = new Config();
$dbconfig = new Include_DBConfig();

if(isset($_SESSION["loai_hienthi"]))
{
    $registry->loai_hien_thi = $_SESSION["loai_hienthi"];
}
else
{
    $registry->loai_hien_thi = $config->loai_hien_thi;   
}
/*
if(isset($_SESSION["mobile"])){
    $registry->mobile = $_SESSION["mobile"];
}
else
{
    $browser = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
    if($browser == true)
    {
        $_SESSION["mobile"] = "true";   
    }
    else
    {
        $_SESSION["mobile"] = "false";
    }
}*/
 /*** load the router ***/
 $registry->router = new router($registry);

 /*** set the controller path ***/
 $registry->router->setPath (__SITE_PATH . '/controller');

 /*** load up the template ***/
 $registry->template = new template($registry);

 /*** load the controller ***/
 $registry->router->loader();

?>